
<meta title="编辑微信号" width="800px" args="app"/>
<form class="form-horizontal"
      id="appForm"
      method="post"
      s="form,valid,nda,datac" s-data="app" action="/api/admin/app/{app.id}" s-valid="{notice: validNotice}"
      style="padding-top: 30px;">
    
        <div class="form-group" s-valid-role="item">
            <label class="col-sm-2 control-label">名称：</label>
            <div class="col-sm-10">
                <input type="text" name="name" class="form-control"
                s-valid-label="名称"
                s-valid-error="require(),len(2,150)">
            </div>
        </div>
    
        <div class="form-group" s-valid-role="item">
            <label class="col-sm-2 control-label">appId：</label>
            <div class="col-sm-10">
                <input type="text" name="appid" class="form-control"
                s-valid-label="appId"
                s-valid-error="require(),len(2,150)">
            </div>
        </div>
    
        <div class="form-group" s-valid-role="item">
            <label class="col-sm-2 control-label">app密钥：</label>
            <div class="col-sm-10">
                <input type="text" name="appsecr" class="form-control"
                s-valid-label="app密钥"
                s-valid-error="require(),len(2,150)">
            </div>
        </div>
    <div class="form-group" s-valid-role="item">
        <label class="col-sm-2 control-label">日限额：</label>
        <div class="col-sm-10">
            <input type="text" name="dayLimit" class="form-control"
                   s-valid-label="日限额"
                   s-valid-error="require(),range(0,1000000)">
        </div>
    </div>

    <div class="form-group" s-valid-role="item">
        <label class="col-sm-2 control-label">总限额：</label>
        <div class="col-sm-10">
            <input type="text" name="allLimit" class="form-control"
                   s-valid-label="总限额"
                   s-valid-error="require(),range(0,100000000)">
        </div>
    </div>

    <div class="form-group" s-valid-role="item">
        <label class="col-sm-2 control-label">规则：</label>
        <div class="col-sm-10">
            <input type="text" name="rule" class="form-control"
                   s-valid-label="规则">
        </div>
    </div>
    
</form>
<script type="text/javascript">
    S.meta.btns = [
        {
            name: "保存",
            style: "btn btn-primary",
            click: function () {
                return S.S("#appForm").submit().done(function (rs) {
                    S.close(rs);
                    S.notice("修改微信号成功", "success");
                });
            }
        },
        {
            name: "关闭",
            style: "btn btn-default",
            click: function () {
                S.close();
            }
        }
    ];

    function validNotice(node, msg, level) {
        if (level == 'error') {
            S.notice(msg, 'danger');
        }
    }
</script>